from sqlalchemy.ext.declarative import declarative_base

Base = declarative_base()

class BaseModel(Base):
    """
    基础模型，提供模型类的通用方法
    """

    # TODO
    __abstract__ = True

    def update_set(self, **kwargs):
        """
        :param kwargs:
        :return:
        """
        for field, value in kwargs.items():
            if hasattr(self, field):
                setattr(self, field, value)